import { http } from "@/utils/http";
import type { BaseProfile, LoginResult } from "@/types/member";

type LoginParams = {
  code: string
  encryptedData: string
  iv: string
}
/**
 * 小程序登录
 * @returns any OK
 * @throws ApiError
 * @param data
 */
export const postLoginWxMinAPI = (data: LoginParams) => {
  return http<LoginResult>({
    url: "/wxapi/wxlogin",
    method: "POST",
    data
  });
};
/**
 * 保存用户昵称与头像
 * @returns any OK
 * @throws ApiError
 * @param data
 */
export const saveUserInfoUsingPost = (data: LoginResult) => {
  return http<LoginResult>({
    url: "/wxapi/saveUserInfo",
    method: "POST",
    data
  });
};
